<?php
/**
 * Created by PhpStorm.
 * User: D
 * Date: 2019/5/13
 * Time: 15:55
 */

header("Content-Type:Application/json;charset=utf-8");
header("Access-Control-Allow-Origin:*");

$_pId=0;
if(isset($_REQUEST["pro_id"])){
    $_pId=$_REQUEST["pro_id"];
}
$dataListStr=file_get_contents("./data/data.json");
if($_pId !=0){
    $arrData=json_decode($dataListStr);
    for($i=0;$i<count($arrData);$i++){
        if($arrData[$i]->pro_id==$_pId){
            print_r(json_encode($arrData[$i]));
            break;
        }
    }
}else{
    print_r($dataListStr);
}